﻿@model Cafe.Models.DetailVM

<h1>Details</h1>

<div>
    <h3>@Model.Cafe.Name</h3>
    <h4>@Model.Cafe.Location</h4>
    <h4>@Model.Cafe.Category</h4>
    <h4>@Model.Cafe.Average</h4>

    <div>
        <table class="table table-hover">
            @foreach (var review in Model.Reviews)
            {
            <tr><td>@review.User</td><td>@review.Rating</td><td>@review.Comment</td>
            <td>
            <form method="post" action="/Home/DeleteReview">
                <input hidden type="text" value="@review.ID" name="id" />
                <input type="submit" value="Delete" />
            </form>    
                
            </td></tr>
            
            }
        </table>
        <form method="get" action="/Home/AddReview">
            <input hidden type="text" name="cafeID" value="@Model.Cafe.ID" />
            <input type="submit" value="Add Review" />
        </form>

    </div>
</div>

